<!DOCTYPE html>
<html lang="en">

<head>

    <!-- Basic Page Needs
  –––––––––––––––––––––––––––––––––––––––––––––––––– -->
    <meta charset="utf-8">
    <title>Test Web Services</title>
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Mobile Specific Metas
  –––––––––––––––––––––––––––––––––––––––––––––––––– -->
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- FONT
  –––––––––––––––––––––––––––––––––––––––––––––––––– -->
    <link href="//fonts.googleapis.com/css?family=Raleway:400,300,600" rel="stylesheet" type="text/css">

    <!-- CSS
  –––––––––––––––––––––––––––––––––––––––––––––––––– -->
    <link rel="stylesheet" href="/css/normalize.css">
    <link rel="stylesheet" href="/css/skeleton.css">

    <!-- Favicon
  –––––––––––––––––––––––––––––––––––––––––––––––––– -->
    <link rel="icon" type="image/png" href="/images/favicon.png">

</head>

<body>

    <!-- Primary Page Layout
  –––––––––––––––––––––––––––––––––––––––––––––––––– -->
    <div class="container">
        <div class="row">
            <div class="twelve column">
                <h4>Test Web Services</h4>
                <p>
                    This is a page for testing web services.
                </p>

                <hr/>

                <h4>Web Services List</h4>
                <ol>
                    <li><a href="#addfacility">Add Facility</a></li>
                    <li><a href="#removefacility">Remove Facility</a></li>
                    <li><a href="#listfacility">List Facility</a></li>
                    <li><a href="#updatefacility">Update Facility</a></li>
                </ol>

                <hr/>

                <h4>Web Services Implmentation</h4>

                <h5><a name="addfacility">Add Facility</a></h5>

                <button type="button" id="testAddFacility" class="btn btn-default">Test Add Facility</button>

                <h5><a name="removefacility">Remove Facility</a></h5>

                <button type="button" id="testRemoveFacility" class="btn btn-default">Test Remove Facility</button>

                <h5><a name="listfacility">List Facility</a></h5>

                <button type="button" id="testListFacility" class="btn btn-default">Test List Facility</button>

                <h5><a name="updatefacility">Update Facility</a></h5>

                <button type="button" id="testUpdateFacility" class="btn btn-default">Test Update Facility</button>

            </div>
        </div>
    </div>

    <!-- End Document
  –––––––––––––––––––––––––––––––––––––––––––––––––– -->

    <script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha256-cCueBR6CsyA4/9szpPfrX3s49M9vUU5BgtiJj06wt/s=" crossorigin="anonymous"></script>
    <script src="https://code.jquery.com/ui/1.12.0/jquery-ui.min.js"   integrity="sha256-eGE6blurk5sHj+rmkfsGYeKyZx3M4bG+ZlFyA7Kns7E="   crossorigin="anonymous"></script>
    <script type="text/javascript">
    (function () {
        "use strict";

        $("#testAddFacility").click(function (e) {
            //window.alert("testAddFacility");
            $.ajax({
                type: "PUT",
                url: "/facility/",
                data: JSON.stringify({
                    'testInput': 'okok'
                }),
                dataType: "json",
                contentType: "application/json; charset=utf-8",
                success: function (data, textStatus, xhr) {
                    //debugger;
                    console.log(data);
                },
                error: function (xhr, textStatus, errorThrown) {
                    //debugger;
                    console.log('Error in Operation');
                }
            });
        });
        $("#testRemoveFacility").click(function (e) {
            window.alert("testRemoveFacility");
        });
        $("#testListFacility").click(function (e) {
            window.alert("testListFacility");
            $.ajax({
                type: "GET",
                url: "/facility/",
                data: {},
                dataType: "json",
                contentType: "application/json; charset=utf-8",
                success: function (data, textStatus, xhr) {
                    //debugger;
                    console.log(data);
                },
                error: function (xhr, textStatus, errorThrown) {
                    //debugger;
                    console.log('Error in Operation');
                }
            });
        });
        $("#testUpdateFacility").click(function (e) {
            window.alert("testUpdateFacility");
        });

    }(jQuery));
  </script>
</body>

</html>